﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NumTools  {
    #region 单例
    private static NumTools instance;

    private NumTools()
    {

    }

    public static NumTools GetInstance()
    {
        if (instance == null)
        {
            instance = new NumTools();
        }
        return instance;
    }
#endregion

    /// <summary>
    /// 返回整数
    /// </summary>
    /// <param name="x"></param>
    /// <returns></returns>
    public int GetIntFromFloat(float x)
    {
        return (int)x * 1000;
    }

    public float GetFloatFromInt(int x)
    {
        return x*0.001f;
    }
}
